|
|
|
|
|
|
|
huge project full of a dizzying number of classes and lines of code is difficult to maintain, and you'll quickly lose the benefits of object-oriented programming. |
|
|
|
|
|
|
|
|
Incorporating the Subsystem into the Samsona Bank Teller System Example |
|
|
|
|
|
|
|
|
The branch manager has a simple requirement: Make sure that we can save all our account transactions, customer information, and cash deposit records. Because you're using a relational database, you sit down with a database administrator at the bank to come up with an acceptable database schema. The tables resulting from these conversations are named tblAccount, tblBankProduct, tblTransaction_Archive, tblCustomer, and tblCash_Deposit_Record. The branch manager makes things easy on you this time, requiring only that you provide a mechanism for obtaining and inserting records. The update operations will be handled by her in-house development staff. |
|
|
|
|
|
|
|
|
The code listings for this section would be too numerous to present here. However, it is worthwhile to list the code for both the DBAdoConnection and DBAdoResultset classes. Listing 19.1 shows the code for DBAdoConnection, and Listing 19.2 shows the code for DBAdoResultset. Grab a cup of your favorite beverage because the listings are full of helpful class methodsquite a few of them. You can also access them on the CD-ROM. They're presented here as a convenience so that you can become acquainted with the kind of data access code you should try to use and expand on when developing your applications. |
|
|
|
|
|
|
|
|
LISTING 19.1. THE CODE FOR THEDBAdoConnectionCLASS. |
|
|
|
 |
|
|
|
|
1: VERSION 1.0 CLASS
2: BEGIN
3: MultiUse = -1 'True
4: END
5: Attribute VB_Name = DBAdoConnection
6: Attribute VB_GlobalNameSpace = True
7: Attribute VB_Creatable = True
8: Attribute VB_PredeclaredId = False
9: Attribute VB_Exposed = False
10: Attribute VB_Ext_KEY = SavedWithClassBuilder ,Yes
11: Attribute VB_Ext_KEY = Top_Level ,Yes
12: Attribute VB_Ext_KEY = RVB_UniqueId ,352AB4C70302
13: 'local variable(s) to hold property value(s)
14: '##ModelId=352AB4C8010F
15: Private mvarpTblColumns As ADODB.Fields 'local copy
16: '##ModelId=352AB4C801B0
17: Private mvarpResultset As ADOR.Recordset 'local copy
|
|
|
|
|
|